#/usr/bin/env python
# gdata-python-client
# http://code.google.com/p/gdata-python-client/downloads/list
#
# require httplib,urllib


import sys

if len(sys.argv)!=3:
  print >>sys.stderr,"usage: %s <user@domain> <password>"%sys.argv[0]
  sys.exit(2)


import gdata.docs.data
import gdata.docs.client

user,domain=sys.argv[1].split("@")
password=sys.argv[2]

client = gdata.docs.client.DocsClient(source=domain)
client.ssl = True
client.http_client.debug = True

# See also
# http://code.google.com/apis/gdata/faq.html#clientlogin
token=client.ClientLogin("%s@%s"%(user,domain),password,"writely")

feed=client.GetFeed("/feeds/default/private/full?showfolders=true")

for e in feed.entry:
  print e.title.text

